using System;
using System.Globalization;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Xml;
using System.Reflection;
using Services;
using Utilities.Menu.UIElements;
using BowMaster.Resources;
using Utilities;
using BowMaster.SceneElements;

namespace BowMaster
{
    public static class StaticUtilities
    {
        public static bool RectContainsVect(Rectangle rect, Vector2 v)
        {
            return rect.X < v.X && rect.Y < v.Y && rect.X + rect.Width > v.X && rect.Y + rect.Height > v.Y;
        }
       
        public static bool RectContainsVect(BoundingSphere sphere, Arrow a)
        {
            var r = new Ray(new Vector3(a.point, 0), Vector3.Normalize(new Vector3(-a.point + a.position, 0)*new Vector3(1,-1,1)));
            var i = r.Intersects(sphere);
            return i.HasValue && i.Value < sphere.Radius;
            //return sphere.Contains(new Vector3(v, 0)) != ContainmentType.Disjoint;
        }
    }
}
